#include "decryption.h"

void rc6_decrypiton( word* ciphertext , word* plaintext , word* S )
{
	int round  = RC6_ROUND ;
	ciphertext[2] = ciphertext[2] - S[2*RC6_ROUND + 3] ;
	ciphertext[0] = ciphertext[0] - S[2*RC6_ROUND + 2] ;
	for ( ; round >= 1 ; --round )
	{
		decryption_oneround( ciphertext , round , S ) ;
	}
	ciphertext[3] = ciphertext[3] - S[1] ;
	ciphertext[1] = ciphertext[1] - S[0] ;
	for ( int i = 0 ; i <= 3 ; ++i )
	{
		plaintext[i] = ciphertext[i] ;
	}
}